/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Marco Angelo
 */

import javax.swing.JOptionPane;

public class LogoutPrompt {

    public LogoutPrompt(){
        
    }
    public static void main(String[] args) {
    
    }

   public int prompt() {
       int value = 0;
       
    int response = JOptionPane.showConfirmDialog(null, "Are you sure you want to log out?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

    if (response == JOptionPane.NO_OPTION) {
      System.out.println("No button clicked");
      value = 0;
    } else if (response == JOptionPane.YES_OPTION) {
      System.out.println("Yes button clicked");
      value = 1;
    } else if (response == JOptionPane.CLOSED_OPTION) {
      System.out.println("JOptionPane closed");
    }
    return value;
    }

}
